<template>
	<div class="layout-pd">
        <Menu v-if="state.menuList&&state.menuList.length>0" :menuList="state.menuList"/>
        <el-empty v-else description="没有功能" />
    </div>
</template>
<script lang="ts" setup name="commonPage">
import Menu from './component/menu.vue';
//------------------内部变量定义-------------------------
const route = useRoute();
const state = reactive({
    routerId:'',//路由id
    routesList:$store.routes.routesList,
    menuList:[],//菜单列表
})


// 初始化
onMounted(() => {
	let routerId = route.meta.routerId;
    let retList=[];
    state.routesList.forEach(element => {
        let itemRouterId=element.meta?.routerId
        if(routerId===itemRouterId){
            retList=element.children
        }
    });
    state.menuList=retList
});

</script>
<style scoped lang="scss">
</style>